<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />  
    <title>系统角色</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta name="author" content="飞啊飘啊">
	<meta name="hashcode" content="3615241">
	
	<script>window.duteTag="lz";</script>
	<script type="text/javascript" src="/admin/js/dute-1.0.js"></script>
	<script type="text/javascript" src="/admin/js/jquery-1.7.1.min.js"></script>
	
	<script type="text/javascript" src="/admin/js/lazy3q.ui.js"></script>
	<script>
		document.write('<link rel="stylesheet" type="text/css" href="/admin//css/'+($.cookie('theme')||'elegant')+'/lazy3q.ui.css" /> ');
	</script>
	
	<script type="text/javascript" src="/admin/js/jquery-ui-1.10.2.custom.min.js"></script>
	
	<!-- 用户自定义js(懒加载) -->
	<script type="text/javascript" src="/admin/js/define.js"></script>
	<!-- 用户自定义css样式 -->
	<link rel="stylesheet" type="text/css" href="/admin/css/define.css"/>
	<!-- icon font -->
  	<link rel="stylesheet" href="/admin/css/iconfont.css">
	
	
	
	<script type="text/javascript">
		window.basePath="/";
		window.hashcode = "3615241";
	</script>
		
	<!-- 感谢kindeditor出品的在线HTML编辑控件 -->
	<script type="text/javascript" charset="utf-8" src="/admin/js/kindeditor/kindeditor.js"></script>
		
	<!-- 感谢My97DatePicker出品的时间控件 -->
	<script language="javascript" type="text/javascript" src="/admin/js/My97DatePicker/WdatePicker.js"></script>
	
	<!------------------------VIEW_HTML_HEAD------------------------>
	<!------------------------VIEW_HTML_HEAD------------------------>	
	
</head>
<script>
Page({
  data:{
    
  },
  onLoad: function(options) {
  	var THIS = this;
  	THIS.setData(options);
  	$.getAjax("role.get.do",options,function(protocol){
  		if(protocol.message){
  			$.toast(protocol.message);
  		}
  		document.title={
  			 "insert":"创建系统角色"
  			,"inport":"导入系统角色"
  			,"update":"修改系统角色"
  			,"detail":"系统角色详情"
  		}[options.edittype];
  		THIS.setData(protocol.data); 
  		/******************VIEW_HTML_SET_DATA******************/
  		/******************VIEW_HTML_SET_DATA******************/
  	});
  }
});
</script>
<script>
window["lzFlashUrl"]=top.lzFlashUrl||"/admin/flash/";
window["uploadUrl"]=top.uploadUrl||"/admin/upload.do";

$(function(){
		 
	$("#roleForm").form({
		"":function(){}
		,"srvRole.srId":function(el){
			if($(el).parents("dd:eq(0)").find("b:contains('*')").size()>0){
			}
		}
		,"srvRole.srName":function(el){
			if($(el).parents("dd:eq(0)").find("b:contains('*')").size()>0){
				if(jQuery.trim(el.value)=="")
					return "角色名称不能为空";
			}
			if(el.value.length>32 && el.value.indexOf("[*]")==-1)
				return "角色名称最大长度为32个字符";
		}
		,"srvRole.srFlag":function(el){
			if(el.value.length>32 && el.value.indexOf("[*]")==-1)
				return "角色标识最大长度为32个字符";
		}
		,"srvRole.srProfile":function(el){
			if(el.value.length>256 && el.value.indexOf("[*]")==-1)
				return "角色描述最大长度为256个字符";
		}
		,"srvRole.srUpdateTime":function(el){
			if($(el).parents("dd:eq(0)").find("b:contains('*')").size()>0){
				if(jQuery.trim(el.value)=="")
					return "修改时间不能为空";
			}
		}
		,"srvRole.srAddTime":function(el){
			if($(el).parents("dd:eq(0)").find("b:contains('*')").size()>0){
				if(jQuery.trim(el.value)=="")
					return "添加时间不能为空";
			}
		}
		,"srvRole.srStatus":function(el){
			if($(el).parents("dd:eq(0)").find("b:contains('*')").size()>0){
				if(jQuery.trim(el.value)=="")
					return "请选择状态";
			}
		}
	},function(){
		/******************************LAZY3Q_FORM_VALIDATE******************************/
		/******************************LAZY3Q_FORM_VALIDATE******************************/
	});		
});
</script>

<body style="display:none;">



<!------------------------VIEW_HTML_TOP------------------------>
<!------------------------VIEW_HTML_TOP------------------------>


<form enctype="{{inports!=null?'multipart/form-data':''}}" lz:if="{{edittype=='insert'||edittype=='update'||edittype=='detail'||edittype=='any'||edittype=='inport'}}" class="form editform edittype_{{edittype}}" ref="SrvRole" id="roleForm" name="roleForm" target="jsoniframe" action="role.{{edittype=='any'?'update':edittype}}.do" method="post">
	<div class="head"></div>
	<div class="body">
		<div class="content">
			<div lz:if="{{edittype!='detail'}}" class="prompt">
				温馨提示：请仔细填写系统角色相关信息，<span class="extrude">"*" 为必填选项。</span>
			</div>
			<br/>
			<lz:block lz:if="{{message}}">
			<br/>
			<center>
				<font color="red"><h4>{{message}}</h4></font>
			</center>
			<br/>
			</lz:block>
			<input type="hidden" value="{{complete}}" name="complete" id="complete" />
			<input type="hidden" value="{{ids}}" name="ids" id="ids" />
			<textarea name="PARAMS" id="PARAMS" style="display:none">{{PARAMS}}</textarea>
			
			
			<lz:block lz:if="{{inports}}">
			  <div class="line"></div>
			  <dl style="width:98%;">
			  	<dt>Excel文件:</dt>
			  	<dd>
			  		<input type="hidden" value="{{inports}}" name="inports" id="inports" />
			  		<input type="hidden" value="{{inport$}}" name="inport$" id="inport$" />
			  		<input name="file" name="file" type="file"/>
			  		<b>*</b>
			  		<div>
						请上传excel文件，表格列依次为：[{{inport$}}]，excel表格第一行为列名称，将不作为上传数据行
					</div>
			  	</dd>
			  </dl>
			  <div class="line"></div>
			</lz:block>
	{{lz.set("srId_editable",((edittype=='insert'||(edittype=='inport' && (!lz.idin(inports,"srId"))))&&true)||(edittype=='update'&&true)||((edittype=='any')&&(lz.idin(fields,"srId"))))}}
	{{lz.set("srId_readonly",(edittype=='insert'&&false)||(edittype=='update'&&false)||(edittype=='detail'))}}
	
	{{before$srId}}
	<dl lz:if="{{srId_editable||srId_readonly}}" class="srId hidden " major  ref="srId">
		<dt>编　　号:</dt>
		<dd lz:if="{{srId_editable}}" input="hidden">
			<lz:block lz:if="{{srvRole$srId}}">
				{{srvRole$srId}}
			</lz:block>
			<lz:block lz:if="{{!srvRole$srId}}">
			<input type="hidden" value="{{lz.htm(srvRole.srId)}}" name="srvRole.srId" id="srId" />
	 	 </lz:block>
	 	 
	 	 <em></em> 
	 	 <a class="mui-navigate-right"></a>
		</dd>
		<dd lz:if="{{srId_readonly}}">
		 	<div class="state-input narrow">
		 		<textarea class=""  style="display:none;" id="srId">{{srvRole.srId}}</textarea>
		 		<span>
		 	
			 {{lz.html(srvRole.srId$||srvRole.srId)}}
	 	 		</span>
	 	 	</div>
		</dd>
	</dl>
	{{after$srId}}
	{{lz.set("srName_editable",((edittype=='insert'||(edittype=='inport' && (!lz.idin(inports,"srName"))))&&true)||(edittype=='update'&&true)||((edittype=='any')&&(lz.idin(fields,"srName"))))}}
	{{lz.set("srName_readonly",(edittype=='insert'&&false)||(edittype=='update'&&false)||(edittype=='detail'))}}
	
	{{before$srName}}
	<dl lz:if="{{srName_editable||srName_readonly}}" class="srName  " major  ref="srName">
		<dt>角色名称:</dt>
		<dd lz:if="{{srName_editable}}" input="text">
			<lz:block lz:if="{{srvRole$srName}}">
				{{srvRole$srName}}
			</lz:block>
			<lz:block lz:if="{{!srvRole$srName}}">
		 	<input type="text" class="input narrow"   name="srvRole.srName" id="srName"  value="{{lz.htm(srvRole.srName)}}"/>
	 	 </lz:block>
	 	 <b>*</b>
	 	 <em>请输入系统角色的角色名称</em> 
	 	 <a class="mui-navigate-right"></a>
		</dd>
		<dd lz:if="{{srName_readonly}}">
		 	<div class="state-input narrow">
		 		<textarea class=""  style="display:none;" id="srName">{{srvRole.srName}}</textarea>
		 		<span>
		 	
			 {{lz.html(srvRole.srName$||srvRole.srName)}}
	 	 		</span>
	 	 	</div>
		</dd>
	</dl>
	{{after$srName}}
	{{lz.set("srFlag_editable",((edittype=='insert'||(edittype=='inport' && (!lz.idin(inports,"srFlag"))))&&true)||(edittype=='update'&&true)||((edittype=='any')&&(lz.idin(fields,"srFlag"))))}}
	{{lz.set("srFlag_readonly",(edittype=='insert'&&false)||(edittype=='update'&&false)||(edittype=='detail'))}}
	
	{{before$srFlag}}
	<dl lz:if="{{srFlag_editable||srFlag_readonly}}" class="ribs srFlag  " major  ref="srFlag">
		<dt>角色标识:</dt>
		<dd lz:if="{{srFlag_editable}}" input="text">
			<lz:block lz:if="{{srvRole$srFlag}}">
				{{srvRole$srFlag}}
			</lz:block>
			<lz:block lz:if="{{!srvRole$srFlag}}">
		 	<input type="text" class="input narrow"  maxlength="32" name="srvRole.srFlag" id="srFlag"  value="{{lz.htm(srvRole.srFlag)}}"/>
	 	 </lz:block>
	 	 
	 	 <em>请输入系统角色的角色标识</em> 
	 	 <a class="mui-navigate-right"></a>
		</dd>
		<dd lz:if="{{srFlag_readonly}}">
		 	<div class="state-input narrow">
		 		<textarea class=""  style="display:none;" id="srFlag">{{srvRole.srFlag}}</textarea>
		 		<span>
		 	
			 {{lz.html(srvRole.srFlag$||srvRole.srFlag)}}
	 	 		</span>
	 	 	</div>
		</dd>
	</dl>
	{{after$srFlag}}
	{{lz.set("srProfile_editable",((edittype=='insert'||(edittype=='inport' && (!lz.idin(inports,"srProfile"))))&&true)||(edittype=='update'&&true)||((edittype=='any')&&(lz.idin(fields,"srProfile"))))}}
	{{lz.set("srProfile_readonly",(edittype=='insert'&&false)||(edittype=='update'&&false)||(edittype=='detail'))}}
	
	{{before$srProfile}}
	<dl lz:if="{{srProfile_editable||srProfile_readonly}}" class="ribs srProfile   wider" major  ref="srProfile">
		<dt>角色描述:</dt>
		<dd lz:if="{{srProfile_editable}}" input="textarea">
			<lz:block lz:if="{{srvRole$srProfile}}">
				{{srvRole$srProfile}}
			</lz:block>
			<lz:block lz:if="{{!srvRole$srProfile}}">
		 	<textarea class="input wide"  id="srProfile" name="srvRole.srProfile" rows="5">{{srvRole.srProfile}}</textarea>
	 	 </lz:block>
	 	 
	 	 <em>请输入系统角色的角色描述</em> 
	 	 <a class="mui-navigate-right"></a>
		</dd>
		<dd lz:if="{{srProfile_readonly}}">
		 	<div class="state-input wide">
		 		<span>
		 	
			 {{lz.html(srvRole.srProfile$||srvRole.srProfile)}}
	 	 		</span>
	 	 	</div>
		</dd>
	</dl>
	{{after$srProfile}}
	{{lz.set("srUpdateTime_editable",((edittype=='insert'||(edittype=='inport' && (!lz.idin(inports,"srUpdateTime"))))&&false)||(edittype=='update'&&false)||((edittype=='any')&&(lz.idin(fields,"srUpdateTime"))))}}
	{{lz.set("srUpdateTime_readonly",(edittype=='insert'&&false)||(edittype=='update'&&false)||(edittype=='detail'))}}
	
	{{before$srUpdateTime}}
	<dl lz:if="{{srUpdateTime_editable||srUpdateTime_readonly}}" class="srUpdateTime  " major  ref="srUpdateTime">
		<dt>修改时间:</dt>
		<dd lz:if="{{srUpdateTime_editable}}" input="datetime">
			<lz:block lz:if="{{srvRole$srUpdateTime}}">
				{{srvRole$srUpdateTime}}
			</lz:block>
			<lz:block lz:if="{{!srvRole$srUpdateTime}}">
		 	<input onchange="void(0);" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" type="text" class="datetime input narrow" maxlength="19" name="srvRole.srUpdateTime" id="srUpdateTime"  value="{{srvRole.srUpdateTime$}}"/>
	 	 </lz:block>
	 	 <b>*</b>
	 	 <em>请选择系统角色的修改时间</em> 
	 	 <a class="mui-navigate-right"></a>
		</dd>
		<dd lz:if="{{srUpdateTime_readonly}}">
		 	<div class="state-input narrow">
		 		<textarea class=""  style="display:none;" id="srUpdateTime">{{srvRole.srUpdateTime}}</textarea>
		 		<span>
		 	
			 {{lz.html(srvRole.srUpdateTime$||srvRole.srUpdateTime)}}
	 	 		</span>
	 	 	</div>
		</dd>
	</dl>
	{{after$srUpdateTime}}
	{{lz.set("srAddTime_editable",((edittype=='insert'||(edittype=='inport' && (!lz.idin(inports,"srAddTime"))))&&false)||(edittype=='update'&&false)||((edittype=='any')&&(lz.idin(fields,"srAddTime"))))}}
	{{lz.set("srAddTime_readonly",(edittype=='insert'&&false)||(edittype=='update'&&false)||(edittype=='detail'))}}
	
	{{before$srAddTime}}
	<dl lz:if="{{srAddTime_editable||srAddTime_readonly}}" class="srAddTime  " major  ref="srAddTime">
		<dt>添加时间:</dt>
		<dd lz:if="{{srAddTime_editable}}" input="datetime">
			<lz:block lz:if="{{srvRole$srAddTime}}">
				{{srvRole$srAddTime}}
			</lz:block>
			<lz:block lz:if="{{!srvRole$srAddTime}}">
		 	<input onchange="void(0);" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" type="text" class="datetime input narrow" maxlength="19" name="srvRole.srAddTime" id="srAddTime"  value="{{srvRole.srAddTime$}}"/>
	 	 </lz:block>
	 	 <b>*</b>
	 	 <em>请选择系统角色的添加时间</em> 
	 	 <a class="mui-navigate-right"></a>
		</dd>
		<dd lz:if="{{srAddTime_readonly}}">
		 	<div class="state-input narrow">
		 		<textarea class=""  style="display:none;" id="srAddTime">{{srvRole.srAddTime}}</textarea>
		 		<span>
		 	
			 {{lz.html(srvRole.srAddTime$||srvRole.srAddTime)}}
	 	 		</span>
	 	 	</div>
		</dd>
	</dl>
	{{after$srAddTime}}
	{{lz.set("srStatus_editable",((edittype=='insert'||(edittype=='inport' && (!lz.idin(inports,"srStatus"))))&&false)||(edittype=='update'&&true)||((edittype=='any')&&(lz.idin(fields,"srStatus"))))}}
	{{lz.set("srStatus_readonly",(edittype=='insert'&&false)||(edittype=='update'&&false)||(edittype=='detail'))}}
	
	{{before$srStatus}}
	<dl lz:if="{{srStatus_editable||srStatus_readonly}}" class="srStatus  " major  ref="srStatus">
		<dt>状　　态:</dt>
		<dd lz:if="{{srStatus_editable}}" input="select">
			<lz:block lz:if="{{srvRole$srStatus}}">
				{{srvRole$srStatus}}
			</lz:block>
			<lz:block lz:if="{{!srvRole$srStatus}}">
		 	<select class="narrow" id="srStatus" name="srvRole.srStatus">
		 		<option value="">请选择</option>
				<option value="1" selected='{{srvRole.srStatus=="1"?"selected":""}}'>正常</option>
				<option value="0" selected='{{srvRole.srStatus=="0"?"selected":""}}'>无效</option>
		 	</select>
	 	 </lz:block>
	 	 <b>*</b>
	 	 <em>请选择系统角色的状态</em> 
	 	 <a class="mui-navigate-right"></a>
		</dd>
		<dd lz:if="{{srStatus_readonly}}">
		 	<div class="state-input narrow">
		 		<textarea class=""  style="display:none;" id="srStatus">{{srvRole.srStatus}}</textarea>
		 		<span>
		 	
			 {{lz.html(srvRole.srStatus$||srvRole.srStatus)}}
	 	 		</span>
	 	 	</div>
		</dd>
	</dl>
	{{after$srStatus}}
			
			
			<div class="line">
				<center lz:if="{{edittype=='insert'}}">
					<a onclick="$('.ribs').show();window.fireResize();$('.ribs-handle').toggle();" href="javascript:void(0);" class="state-content ribs-handle" style="display:inline;padding: 0px 15px;">点击展开更多编辑项</a>
					<a onclick="$('.ribs').hide();window.fireResize();$('.ribs-handle').toggle();" href="javascript:void(0);" class="state-content ribs-handle" style="display:none;padding: 0px 15px;">点击收起更多编辑项</a>
				</center>
			</div>
			<center class="buttons">
				<input type="hidden" value="{{srvRole.srId}}" name="srvRole.srId" id="srId" />
			
			<lz:block lz:if="{{edittype=='insert'||edittype=='update'||edittype=='any'||edittype=='inport'}}">
				<button class="button" type="submit">
					&nbsp;<img class="iconA" align="absmiddle" width="20" src="/admin/images/icons/Badge-tick.png"/>
					<span class="iconB iconfont icon-weibiaoti8"></span>
					保存&nbsp;&nbsp;</button>
				<button title="不保存数据,关闭窗口,不刷新原列表" class="button" onclick="cancel();" type="button">
					&nbsp;<img class="iconA" align="absmiddle" width="20" src="/admin/images/icons/Badge-multiply.png"/>
					<span class="iconB iconfont icon-icon11"></span>
					关闭&nbsp;&nbsp;</button>
			</lz:block>
			
			<lz:block lz:if="{{edittype=='detail'}}">
				<button lz:if="{{canEdit}}" type="button" class="button" onclick='window.location.href="/admin/permissions/role.edit.html?edittype=update&id={{srvRole.id}}"'>
					&nbsp;<img class="iconA" align="absmiddle" width="20" src="/admin/images/icons/Badge-tick.png"/>
					<span class="iconB iconfont icon-weibiaoti8"></span>
					修改&nbsp;&nbsp;</button>
				<button lz:if="{{canDel}}" type="button" class="button" onclick="deleteRole('{{srvRole.id}}','{{srvRole.srName}}')">
					&nbsp;<img class="iconA" align="absmiddle" width="20" src="/admin/images/icons/Badge-multiply.png"/>
					<span class="iconB iconfont icon-icon11"></span>
					删除&nbsp;&nbsp;</button>
				<button title="不保存数据,关闭窗口,不刷新原列表" class="button" onclick="cancel();" type="button">
					&nbsp;<img class="iconA" align="absmiddle" width="20" src="/admin/images/icons/Badge-multiply.png"/>
					<span class="iconB iconfont icon-icon11"></span>
					关闭&nbsp;&nbsp;</button>
			</lz:block>
					
			</center>
			<br/>

		</div>
	</div>
	<div class="foot"></div>		
</form>

 


<!------------------------VIEW_HTML_BOTTOM------------------------>
<!------------------------VIEW_HTML_BOTTOM------------------------>


</body>

<!------------------------VIEW_HTML_FOOTER------------------------>
<!------------------------VIEW_HTML_FOOTER------------------------>
<script>
	
	$(function(){
		if(parent.setit){
			parent.setit("/admin/permissions/role.edit.html",document.title,"/admin//images/icons/2008112220121595877802.png");
		}
	});
	
	function cancel(){
		if(parent.closeHref){
			parent.closeHref("/admin/permissions/role.edit.html");
		}else{
			$.closeModalDialog();
		}
	}


	/**
	* 删除系统角色
	**/
	function deleteRole(id,flag)
	{
		var dialog=top.$.dialog({
				html:"<span style='white-space:nowrap;'>确定要删除当前数据吗？</span>",
				title:"删除系统角色",
				modal: true,			
				onOk:function(){
					dialog.closeDialog();
					var url = "/admin/permissions/role.delete.do";
					var params = {id:id};
					var protocol = $.getAjax(url,params);
					if(protocol.message){
						top.$.toast(protocol.message);
					}
					if(protocol.success){
						caller.location.href=caller.location.href;		
					}
				}
		 });	
	}
</script>
</html>